﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Drawing;


namespace sistemaAcademicoFinanceiroEscolas
{
    public partial class extratoAulaProfessor : System.Web.UI.Page
    {
        validarValores vV = new validarValores();
        public double valorTotal;

        public SqlConnection conexaoGrupo = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
        public SqlCommand cmdPrincipalGrupo;
        public SqlDataReader drPrincipalGrupo;
        public string sqlGrupo;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                // Carregar alunos existentes e ativos

                SqlConnection sqlc = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
                sqlc.Open();
                SqlConnection sqld = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
                sqld.Open();

;



                string sqlProfessor = "select * from professor order by nomeProfessor";

                SqlCommand cmdProfessor = new SqlCommand(sqlProfessor, sqlc);
                SqlDataReader myReaderProfessor = cmdProfessor.ExecuteReader();

                ListItem ProfessorSelecione = new ListItem();
                ProfessorSelecione.Value = "0";
                ProfessorSelecione.Text = "Selecione um Professor";

                lstProfessor.Items.Add(ProfessorSelecione);

                if (myReaderProfessor.HasRows)
                {

                    while (myReaderProfessor.Read())
                    {
                        ListItem Professor = new ListItem();

                        Professor.Value = myReaderProfessor["codigoProfessor"].ToString();
                        Professor.Text = myReaderProfessor["nomeProfessor"].ToString();

                        lstProfessor.Items.Add(Professor);
                    }

                }
                //Aluno carregados
                myReaderProfessor.Close();
                cmdProfessor.Dispose();

                //Codigo Ano Letivo
                string sqlano = "select * from anoletivo order by codigoAnoLetivo desc";

                SqlCommand cmdano = new SqlCommand(sqlano, sqlc);
                SqlDataReader myReaderano = cmdano.ExecuteReader();

                ListItem anoSelecione = new ListItem();


                anoSelecione.Value = "0";
                anoSelecione.Text = "Selecione um ano";


                lstAno.Items.Add(anoSelecione);

                if (myReaderano.HasRows)
                {

                    while (myReaderano.Read())
                    {
                        ListItem ano = new ListItem();

                        ano.Value = myReaderano["codigoAnoLetivo"].ToString();
                        ano.Text = myReaderano["descricaoAnoLetivo"].ToString();

                        if (Convert.ToInt16(myReaderano["descricaoAnoLetivo"]) <= Convert.ToInt16(DateTime.Now.Year))
                        {
                            lstAno.Items.Add(ano);
                        }
                    }

                }
                //ano carregados
                myReaderano.Close();
                cmdano.Dispose();

                // fechando conexão com o banco de dados
                sqlc.Close();




                //Codigo Mes
                string sqlmes = "select * from mes order by codigoMes ";

                SqlCommand cmdmes = new SqlCommand(sqlmes, sqld);
                SqlDataReader myReadermes = cmdmes.ExecuteReader();

                ListItem mesSelecione = new ListItem();


                mesSelecione.Value = "0";
                mesSelecione.Text = "Selecione um mes";


                lstMes.Items.Add(mesSelecione);

                if (myReadermes.HasRows)
                {

                    while (myReadermes.Read())
                    {
                        ListItem mes = new ListItem();

                        mes.Value = myReadermes["codigoMes"].ToString();
                        mes.Text = myReadermes["descricaoMes"].ToString();

                        //if (Convert.ToInt16(myReadermes["descricaoMes"]) <= Convert.ToInt16(DateTime.Now.Year))
                        //{
                        lstMes.Items.Add(mes);
                        //}
                    }

                }
                //mes carregados
                myReadermes.Close();
                cmdmes.Dispose();

                // fechando conexão com o banco de dados
                sqld.Close();
            }
        }

        protected void btnListar_Click(object sender, EventArgs e)
        {
            preListar();
        }

        void preListar()
        {
            if (lstProfessor.SelectedValue == "0" || lstAno.SelectedValue == "0")
            {
                string validacao = "<script language=javascript>alert('Selecione um aluno e um ano para gerar o extrato.');</script>";
                Panel1.Controls.Add(new LiteralControl(validacao));
                lstProfessor.Focus();
                Panel3.Visible = false;
                lstProfessor.Visible = false;
            }
            else
            {
                listar(lstProfessor.SelectedValue);
                listarPagamentos(lstProfessor.SelectedValue);
                atualizarValores();
                Panel3.Visible = true;
                lstProfessor.Visible = true;
            }
        }

        void listar(string codigoAluno)
        {
            SqlConnection sqld = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
            sqld.Open();

            SqlConnection conexaoGrupo = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
            conexaoGrupo.Open();

            string conteudo = "", selectAula = "";
            lblProfessor.Text = lstProfessor.SelectedItem.Text;
            conteudo += "<div id=\"accordion\" style=\"background-color: #f6f9fc\">";

            valorTotal = 0;
            conteudo += "<div class=\"pane\" style=\"display:block\">";
            conteudo += "<table width=\"100%\" border=\"1\" cellpadding=\"5\" cellspacing=\"0\" bordercolor=\"#99CCFF\" align=\"center\"><tr>";
            conteudo += "<th align=\"center\" colspan=\"6\">Aulas</th></tr>";

            selectAula = "SELECT a.codigoAula, a.codigoProfessor, a.codigoTipoAula, ";
            selectAula += "(select nomeProfessor from professor where a.codigoProfessor = professor.codigoProfessor) as nomeProfessor, ";

            selectAula += "(select nomeAluno from aluno where a.codigoAluno = aluno.codigoAluno) as nomeAluno, ";

         

            selectAula += "(select descricaoDisciplina from disciplina where a.codigoDisciplina = disciplina.codigoDisciplina) as descricaoDisciplina, ";


            selectAula += "a.codigoProfessor, a.codigoGrupo, a.dataAula, a.horaInicialAula, a.horaFinalAula, a.codigoDisciplina, a.descricaoAssuntoAula, ";
            selectAula += "a.aulaRealizada, a.observacoesAula, a.valorHora, a.pago, a.aulaCancelada, a.valorPago, ";
            selectAula += "a.valorTotalSemDesconto, a.valorTotalComDesconto, a.codigoAnoLetivo, a.falta, a.meiaHora, ";

            selectAula += "(select v.aulaValor from valorAula v ";
            selectAula += "where convert(datetime,a.dataAula,103) BETWEEN convert(datetime, v.dataInicial,103) ";
            selectAula += "AND convert(datetime, v.dataFinal,103) and a.codigoTipoAula = v.codigoTipoAula) as valorAula, ";

            selectAula += "(select v.valorValorEspecialAluno from valorEspecialAluno v ";
            selectAula += "where convert(datetime,a.dataAula,103) BETWEEN convert(datetime, v.dataInicialValorEspecialAluno,103) ";
            selectAula += "AND convert(datetime, v.dataFinalValorEspecialAluno,103) and a.codigoAluno = v.codigoAluno) as valorAulaEspecialAluno, ";

            selectAula += "(select v.valorValorEspecialGrupo from valorEspecialGrupo v ";
            selectAula += "where convert(datetime,a.dataAula,103) BETWEEN convert(datetime, v.dataInicialValorEspecialGrupo,103) ";
            selectAula += "AND convert(datetime, v.dataFinalValorEspecialGrupo,103) and a.codigoGrupo = v.codigoGrupo) as valorAulaEspecialGrupo ";

            selectAula += "FROM aula a ";

            if (lstMes.SelectedValue == "0")
            {

                selectAula += "WHERE a.codigoProfessor = " + lstProfessor.SelectedValue + " and a.aulaRealizada = 1 and a.codigoAnoLetivo = " + lstAno.SelectedValue;
                selectAula += " order by convert(datetime,a.dataAula,103) desc, CONVERT(INT, SUBSTRING(a.horaInicialAula,1 , 2))  ";
            }
            else
            {
                selectAula += "WHERE a.codigoProfessor = " + lstProfessor.SelectedValue + " and a.aulaRealizada = 1 and CONVERT(INT, SUBSTRING(a.dataAula,4 , 2)) = " + lstMes.SelectedValue + " and a.codigoAnoLetivo = " + lstAno.SelectedValue;
                selectAula += " order by convert(datetime,a.dataAula,103) desc, CONVERT(INT, SUBSTRING(a.horaInicialAula,1 , 2))  ";
            }



            SqlCommand cmdPrincipal = new SqlCommand(selectAula, sqld);
            SqlDataReader drPrincipal = cmdPrincipal.ExecuteReader();


            conteudo += "<tr>";
            conteudo += "<th>Data da aula</th>";
            conteudo += "<th>Horário</th>";
            conteudo += "<th>Aluno/Grupo</th>";
            conteudo += "<th>Disciplina</th>";
            conteudo += "<th>Valor</th>";
            conteudo += "<th>Tipo</th>";

           

            if (drPrincipal.HasRows)
            {
                while (drPrincipal.Read())
                {
                    conteudo += "<tr align=\"center\">";
                    conteudo += "<td align='center'>" + drPrincipal["dataAula"].ToString() + "</td>";
                    conteudo += "<td align='center'>" + drPrincipal["horaInicialAula"].ToString() + "" + " às " + "" + drPrincipal["horaFinalAula"].ToString() + "</td>";

                    if (drPrincipal["nomeAluno"].ToString() == "")
                    {
                        sqlGrupo = "SELECT codigoAlunoGrupo, codigoGrupo, codigoAluno, ";
                        sqlGrupo += "(SELECT nomeAluno FROM aluno WHERE (alunoGrupo.codigoAluno = aluno.codigoAluno)) AS nomeAluno ";
                        sqlGrupo += "FROM alunoGrupo where codigoGrupo = " + drPrincipal["codigoGrupo"].ToString();

                        cmdPrincipalGrupo = new SqlCommand(sqlGrupo, conexaoGrupo);
                        drPrincipalGrupo = cmdPrincipalGrupo.ExecuteReader();

                        conteudo += "<td style=\"width:400px;\">";

                        if (drPrincipalGrupo.HasRows)
                        {
                            while (drPrincipalGrupo.Read())
                            {
                                
                                conteudo += drPrincipalGrupo["nomeAluno"].ToString() + "<br>";
                                

                            }
                        }
                        drPrincipalGrupo.Close();
                      
                    }
                    else
                    {
                        conteudo += "<td align='center'>" + drPrincipal["nomeAluno"].ToString() + "</td>"; 
                    }

                           
                    conteudo += "<td align='center'>" + drPrincipal["descricaoDisciplina"].ToString() + "</td>";
                    conteudo += "<td align='center'>";

                    if (drPrincipal["codigoGrupo"].ToString() != "")
                    {
                        if (drPrincipal["valorAulaEspecialGrupo"].ToString().Replace(" ", "") != "")
                        {
                            try
                            {
                                if (Convert.ToBoolean(drPrincipal["meiaHora"]))
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAulaEspecialGrupo"].ToString()) * 0.6/2).ToString().Trim()) + "</td>";
                                    valorTotal = valorTotal + (Convert.ToDouble(drPrincipal["valorAulaEspecialGrupo"].ToString())  * 0.6 /2);
                                }
                                else
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAulaEspecialGrupo"].ToString()) * 0.6).ToString().Trim()) + "</td>";
                                    valorTotal += Convert.ToDouble(drPrincipal["valorAulaEspecialGrupo"].ToString()) * 0.6;
                                }
                            }
                            catch
                            {
                            }
                        }
                        else
                        {
                            try
                            {
                                if (Convert.ToBoolean(drPrincipal["meiaHora"]))
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAula"].ToString())  * 0.6 /2).ToString().Trim()) + "</td>";
                                    valorTotal = valorTotal + (Convert.ToDouble(drPrincipal["valorAula"].ToString())  * 0.6 /2);
                                }
                                else
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAula"].ToString()) * 0.6).ToString().Trim()) + "</td>";
                                    valorTotal += Convert.ToDouble(drPrincipal["valorAula"].ToString()) * 0.6;
                                }
                            }
                            catch
                            {
                            }
                        }
                        conteudo += "<td align='center'><img src=\"../images/groupP.png\" title=\"Grupo\"></td>";
                    }
                    else
                    {
                        if (drPrincipal["valorAulaEspecialAluno"].ToString().Replace(" ", "") != "")
                        {
                            try
                            {
                                if (Convert.ToBoolean(drPrincipal["meiaHora"]))
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAulaEspecialAluno"].ToString()) / 4).ToString().Trim()) + "</td>";
                                    valorTotal = valorTotal + (Convert.ToDouble(drPrincipal["valorAulaEspecialAluno"].ToString()) / 4);
                                }
                                else
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAulaEspecialAluno"].ToString()) * 0.5).ToString().Trim()) + "</td>";
                                    valorTotal += Convert.ToDouble(drPrincipal["valorAulaEspecialAluno"].ToString()) * 0.5;
                                }
                            }
                            catch
                            {
                            }
                        }
                        else
                        {
                            try
                            {
                                if (Convert.ToBoolean(drPrincipal["meiaHora"]))
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAula"].ToString()) / 4).ToString().Trim()) + "</td>";
                                    valorTotal = valorTotal + (Convert.ToDouble(drPrincipal["valorAula"].ToString()) / 4);
                                }
                                else
                                {
                                    conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAula"].ToString()) * 0.5).ToString().Trim()) + "</td>";
                                    valorTotal += Convert.ToDouble(drPrincipal["valorAula"].ToString()) * 0.5;
                                }
                            }
                            catch
                            {
                            }
                        }
                        conteudo += "<td align='center'><img src=\"../images/aloneP.png\" title=\"Individual\"></td>";

                    }


                    conteudo += "</tr>";
                }
            }
            drPrincipal.Close();

            //conteudo += listarGrupo(lstProfessor.SelectedValue, lstAno.SelectedValue);

            conteudo += "</table>";
            conteudo += "</div>";

            sqld.Close();

            conteudo += "</div>";

            Panel1.Controls.Add(new LiteralControl(conteudo));

            ldlValor.Text = "R$ " + vV.validar(valorTotal.ToString());
        }

        /*string listarGrupo(string codigoProfessor, string codigoAnoLetivo)
        {
            string conteudo = "";

            //string select = "select * from alunoGrupo where codigoAluno = " + codigoAluno;

            SqlConnection sqlc = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
            sqlc.Open();
            SqlConnection sqld = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
            sqld.Open();

            //SqlCommand cmdAlunoGrupo = new SqlCommand(select, sqlc);
            //SqlDataReader myReaderAlunoGrupo = cmdAlunoGrupo.ExecuteReader();

            //if (myReaderAlunoGrupo.HasRows)
            //{
            //    while (myReaderAlunoGrupo.Read())
            //    {
                    string selectAula = "SELECT a.codigoAula, a.codigoProfessor, a.codigoTipoAula, ";
                    selectAula += "(select nomeProfessor from professor where a.codigoProfessor = professor.codigoProfessor) as nomeProfessor, ";

                    selectAula += "a.codigoProfessor, a.codigoGrupo, a.dataAula, a.horaInicialAula, a.horaFinalAula, a.codigoDisciplina, a.descricaoAssuntoAula, ";
                    selectAula += "a.aulaRealizada, a.observacoesAula, a.valorHora, a.pago, a.aulaCancelada, a.valorPago, ";
                    selectAula += "a.valorTotalSemDesconto, a.valorTotalComDesconto, a.codigoAnoLetivo, a.falta, a.meiaHora, ";

                    selectAula += "(select v.aulaValor from valorAula v ";
                    selectAula += "where convert(datetime,a.dataAula,103) BETWEEN convert(datetime, v.dataInicial,103) ";
                    selectAula += "AND convert(datetime, v.dataFinal,103) and a.codigoTipoAula = v.codigoTipoAula) as valorAula, ";

                    selectAula += "(select v.valorValorEspecialGrupo from valorEspecialGrupo v ";
                    selectAula += "where convert(datetime,a.dataAula,103) BETWEEN convert(datetime, v.dataInicialValorEspecialGrupo,103) ";
                    selectAula += "AND convert(datetime, v.dataFinalValorEspecialGrupo,103) ";

                    selectAula += "FROM aula a ";

                    if (lstMes.SelectedValue == "0")
                    {
                        selectAula += "WHERE a.codigoProfessor = " + codigoProfessor + " and a.aulaRealizada = 1 and a.codigoAnoLetivo = " + lstAno.SelectedValue;
                        selectAula += " order by convert(datetime,a.dataAula,103) desc, CONVERT(INT, SUBSTRING(a.horaInicialAula,1 , 2))  ";
                    }
                    else
                    {
                        selectAula += "WHERE a.codigoProfessor = " + codigoProfessor + " and a.aulaRealizada = 1 and CONVERT(INT, SUBSTRING(a.dataAula,4 , 2)) = " + lstMes.SelectedValue + " and a.codigoAnoLetivo = " + lstAno.SelectedValue;
                        selectAula += " order by convert(datetime,a.dataAula,103) desc, CONVERT(INT, SUBSTRING(a.horaInicialAula,1 , 2))  ";
                    }

                    //selectAula += "WHERE a.codigoGrupo = " + myReaderAlunoGrupo["codigoGrupo"].ToString() + " and a.aulaRealizada = 1 and a.codigoAnoLetivo = " + codigoAnoLetivo;
                    //selectAula += " order by convert(datetime,a.dataAula,103) desc, CONVERT(INT, SUBSTRING(a.horaInicialAula,1 , 2))  ";

                    SqlCommand cmdPrincipal = new SqlCommand(selectAula, sqld);
                    SqlDataReader drPrincipal = cmdPrincipal.ExecuteReader();

                    if (drPrincipal.HasRows)
                    {
                        while (drPrincipal.Read())
                        {
                            conteudo += "<tr >";
                            conteudo += "<td align='center'>" + drPrincipal["dataAula"].ToString() + "</td>";
                            conteudo += "<td align='center'>" + drPrincipal["horaInicialAula"].ToString() + "" + " às " + "" + drPrincipal["horaFinalAula"].ToString() + "</td>";
                            conteudo += "<td align='center'>";

                            if (drPrincipal["valorAulaEspecial"].ToString().Replace(" ", "") != "")
                            {
                                try
                                {
                                    if (Convert.ToBoolean(drPrincipal["meiaHora"]))
                                    {
                                        conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAulaEspecial"].ToString()) / 2).ToString().Trim()) + "</td>";
                                        valorTotal = valorTotal + (Convert.ToDouble(drPrincipal["valorAulaEspecial"].ToString()) / 2);
                                    }
                                    else
                                    {
                                        conteudo += vV.validar(drPrincipal["valorAulaEspecial"].ToString().Trim()) + "</td>";
                                        valorTotal += Convert.ToDouble(drPrincipal["valorAulaEspecial"].ToString());
                                    }
                                }
                                catch
                                {
                                }
                            }
                            else
                            {
                                try
                                {
                                    if (Convert.ToBoolean(drPrincipal["meiaHora"]))
                                    {
                                        conteudo += vV.validar((Convert.ToDouble(drPrincipal["valorAula"].ToString().Trim()) / 2).ToString()) + "</td>";
                                        valorTotal = valorTotal + (Convert.ToDouble(drPrincipal["valorAula"].ToString()) / 2);
                                    }
                                    else
                                    {
                                        conteudo += vV.validar(drPrincipal["valorAula"].ToString().Trim()) + "</td>";
                                        valorTotal += Convert.ToDouble(drPrincipal["valorAula"].ToString());
                                    }
                                }
                                catch
                                {
                                }
                            }

                            conteudo += "<td align='center'><img src=\"../images/groupP.png\" title=\"Grupo\"></td>";
                            conteudo += "</tr>";
                        }
                    }
                    drPrincipal.Close();
            //    }
            //}

            //cmdAlunoGrupo.Dispose();
            //myReaderAlunoGrupo.Close();
            sqlc.Close();
            sqld.Close();

            return conteudo;
        }*/

        void listarPagamentos(string codigoAluno)
        {
            SqlConnection sqlc = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
            sqlc.Open();

            string select = "select pagamento.*, (select descricaoFormaPagamento from formaPagamento where formaPagamento.codigoFormaPagamento = pagamento.codigoFormaPagamento) forma from pagamento where codigoAluno = " + codigoAluno;

            SqlCommand cmd = new SqlCommand(select, sqlc);
            SqlDataReader dr = cmd.ExecuteReader();

            string conteudo = "";

            conteudo += "<table width=\"70%\" border=\"1\" cellpadding=\"5\" cellspacing=\"0\" bordercolor=\"#99CCFF\" style=\"background-color:#f6f9fc\">";

            conteudo += "<tr>";
            conteudo += "<th colspan=\"5\">Pagamentos</th>";
            conteudo += "</tr>";

            conteudo += "<tr>";
            conteudo += "<th>Data</th>";
            conteudo += "<th>Valor</th>";
            conteudo += "<th>Forma de pagamento</th>";
            conteudo += "<th>Observações</th>";
            //conteudo += "<th>Ações</th>";
            conteudo += "</tr>";

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    conteudo += "<tr>";
                    conteudo += "<td>" + dr["dataPagamentoAluno"].ToString() + "</td>";
                    conteudo += "<td>R$ " + dr["valor"].ToString() + "</td>";
                    conteudo += "<td>" + dr["forma"].ToString() + "</td>";
                    conteudo += "<td>" + dr["observacoesPagamento"].ToString() + "</td>";
                    //conteudo += "<td><a href=\"" + ConfigurationManager.AppSettings["url"] + "/efetuarPagamentoAluno.aspx?codigoPagamentoAluno=" + dr["codigoPagamentoAluno"].ToString() + "&codigoAluno=" + dr["codigoAluno"].ToString() + "\" title=\"Excluir\"><img src=\"" + ConfigurationManager.AppSettings["url"] + "/images/logo_excluir.png\" /></a></td>";
                    conteudo += "</tr>";
                }
            }
            conteudo += "</table>";

            dr.Close();

            sqlc.Close();

            //Panel2.Controls.Add(new LiteralControl(conteudo));
        }

        void atualizarValores()
        {
            double valorTotal = Convert.ToDouble(ldlValor.Text.Replace("R$ ", ""));
            double valorPago = 0;
            double valorDebitoCredito = 0;

            SqlConnection sqlc = new SqlConnection(ConfigurationManager.AppSettings["baseDados"]);
            sqlc.Open();

            string select = "select * from pagamento where codigoAluno = " + lstProfessor.SelectedValue + " and SUBSTRING(dataPagamentoAluno, 7, 4) = '" + lstAno.SelectedItem.Text + "'";

            SqlCommand cmd = new SqlCommand(select, sqlc);
            SqlDataReader dr = cmd.ExecuteReader();

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    valorPago += Convert.ToDouble(dr["valor"].ToString());
                }
            }

            valorDebitoCredito = valorPago - valorTotal;

            dr.Close();

            sqlc.Close();

            //if (valorDebitoCredito < 0)
            //{
            //    lblDividaCredito.Text = "R$ -" + vV.validar(valorDebitoCredito.ToString().Replace("-", ""));
            //    lblDividaCredito.ForeColor = Color.Red;
            //}
            //else
            //{
            //    lblDividaCredito.Text = "R$ " + vV.validar(valorDebitoCredito.ToString());
            //    lblDividaCredito.ForeColor = Color.Blue;
            //}
            //lblValorPago.Text = "R$ " + vV.validar(valorPago.ToString());
        }
    }
}
